﻿using System.Collections.Generic;
using System.Web.Mvc;
using ABC.Domain.Json;
using ABC.Domain.Serialization;

namespace ABC.Controllers.ViewModels.My
{
    public class CalcKaskoViewModel : CalcKaskoExpressViewModel
    {
        public List<SelectListItem> Regions { get; set; }

        public List<SelectListItem> ListFranshizaInRub { get; set; }

        public List<SelectListItem> ListFranshizaInProc { get; set; }

        public List<SelectListItem> Compensations { get; set; }

        public List<SelectListItem> Payments { get; set; }

        public List<SelectListItem> InsurancePeriods { get; set; }

        public List<SelectListItem> StorageConditions { get; set; }

        public List<SelectListItem> ListMpu { get; set; }

        public List<SelectListItem> SigsAnticreep { get; set; }

        public List<SelectListItem> SigsAntidamping { get; set; }

        public List<SelectListItem> Transitions { get; set; }

        public List<SelectListItem> ListAutoStart { get; set; }

        public List<SelectListItem> SigLabels { get; set; }

        public List<SelectListItem> SignalingsAdditional { get; set; }

        public string CurrentTabId { get; set; }

        public string Region { get; set; }

        public string StateTs { get; set; }

        public string BeginOperation { get; set; }

        public string Guarantee { get; set; }

        public string FranshizaInRub { get; set; }

        public string FranshizaInProc { get; set; }

        public string Compensation { get; set; }

        public string Payment { get; set; }

        public string InsurancePeriod { get; set; }

        public string StorageCondition { get; set; }

        public string MaxPath { get; set; }

        public string Mpu { get; set; }

        public string SigAnticreep { get; set; }

        public string SigAntidamping { get; set; }

        public string Transition { get; set; }

        public string ControlWheel { get; set; }

        public string AutoStart { get; set; }

        public string SigLabel { get; set; }

        public List<FullResult> Results { get; set; }

        public List<Kasko> KaskoTables { get; set; }

        public string KaskoExpressData { get; set; }

        public string ObjectData { get; set; }

        public CalcKaskoViewModel()
        {
            Results = new List<FullResult>();
            KaskoTables = new List<Kasko>();
            Regions = new List<SelectListItem>();
            ListFranshizaInRub = new List<SelectListItem>();
            ListFranshizaInProc = new List<SelectListItem>();
            Compensations = new List<SelectListItem>();
            Payments = new List<SelectListItem>();
            InsurancePeriods = new List<SelectListItem>();
            StorageConditions = new List<SelectListItem>();
            ListMpu = new List<SelectListItem>();
            SigsAnticreep = new List<SelectListItem>();
            SigsAntidamping = new List<SelectListItem>();
            Transitions = new List<SelectListItem>();
            ListAutoStart = new List<SelectListItem>();
            SigLabels = new List<SelectListItem>();
            SignalingsAdditional = new List<SelectListItem>();
            Regions = rbsCalcModel.GetDictionary("Регион");
            ListFranshizaInRub = rbsCalcModel.GetDictionary("Франшиза в рублях");
            ListFranshizaInProc = rbsCalcModel.GetDictionary("Франшиза в процентах");
            Compensations = rbsCalcModel.GetDictionary("Форма возмещения");
            Payments = rbsCalcModel.GetDictionary("Оплата");
            InsurancePeriods = rbsCalcModel.GetDictionary("Срок страхования");
            StorageConditions = rbsCalcModel.GetDictionary("Условия хранения");
            ListMpu = rbsCalcModel.GetDictionary("МПУ");
            ListMpu.ForEach(x => { switch (x.Text) { case "нет":x.Text = "---"; return; } });
            SigsAnticreep = rbsCalcModel.GetDictionary("Противоугонный комплекс");
            SigsAnticreep.ForEach(x => { switch (x.Text) { case "нет":x.Text = "---"; return; } });
            SigsAntidamping = rbsCalcModel.GetDictionary("ОПС");
            SigsAntidamping.ForEach(x => { switch (x.Text) { case "нет":x.Text = "---"; return; } });
            Transitions = rbsCalcModel.GetDictionary("Переход");
            Transitions.Add(new SelectListItem { Text = "С убытками", Value = "С убытками" }); Transitions.Add(new SelectListItem { Text = "Без убытков с подтверждением", Value = "Без убытков с подтверждением" }); Transitions.Add(new SelectListItem { Text = "Без убытков без подтверждения", Value = "Без убытков без подтверждения" });
            ListAutoStart = rbsCalcModel.GetDictionary("ЭПС с автозапуском"); ListAutoStart.Insert(0, new SelectListItem { Text = "---", Value = "---" });
            SigLabels = rbsCalcModel.GetDictionary("Метка"); SigLabels.Insert(0, new SelectListItem { Text = "---", Value = "---" });
            SignalingsAdditional = rbsCalcModel.GetDictionary("ЭПС");
            SignalingsAdditional.ForEach(x => { switch (x.Text) { case "нет":x.Text = "Без дополнительной ЭПС"; return; } });
        }
    }
}
